package com.example.administrator.mvp.module.login;

import com.example.administrator.mvp.base.BasePresenter;
import com.example.administrator.mvp.model.user.UserModel;

/**
 * 执行与登录相关的业务
 */
public class LoginPresenter extends BasePresenter<LoginContract.View, UserModel> implements LoginContract.Presenter {

    public LoginPresenter(LoginContract.View view, UserModel model) {
        super(view, model);
    }

    @Override
    public void login(String userName, String passWord) {
        boolean succ = model.login(userName, passWord);
        if (succ) {
            view.loginSuccess();
        } else {
            view.loginFailure();
        }
    }
}
